﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class person
    {
        //1、音乐老师（既是老师，又是运动员），需要有一种结构，音乐老师继承老师，同时继承运动员。
        //程序员（既是员工，又是作家），需要有一种结构，程序员继承员工，同时继承作家。

        private String _name;
        public string name { get => this._name; set => this._name = value; }



        public person()
        {

        }
        public person(string name)
        {
            this._name = name;
        }

        public virtual void print()
        {
            Console.Write("我叫{0}", this._name);
        }


    }
    class Teacher : person, Ires
    {
        private String _res;
        public string res { get => this._res; set => this._res = value; }

        public Teacher()
        {

        }
        public Teacher(string res, string name) : base(name)
        {
            this._res = res;
        }
        public override void print()
        {
            base.print();
            Console.Write("我是个{0}老师", this._res);
        }
        public void Ires()
        {
            Console.WriteLine("我还是个运动员");
        }

    }
    interface Ires
    {
        void Ires();
    }

    class ProgramMoney:person,Ires
    {
        private String _res;
        public string res { get => this._res; set => this._res = value; }

        public ProgramMoney()
        {

        }
        public ProgramMoney(string res, string name) : base(name)
        {
            this._res = res;
        }
        public override void print()
        {
            base.print();
            Console.Write("我是个{0}", this._res);
        }
        public void Ires()
        {
            Console.WriteLine("我还是个作家");
        }
    }
}
